import type { Directive, DirectiveBinding } from "vue";

export const myColor: Directive = {
    //DOM挂载时触发
    mounted(el: HTMLElement, binding: DirectiveBinding<string>) {
        console.log(el,binding);
        el.style.color=binding.value
    },
    //DOM更新时触发
    updated(el: HTMLElement, binding: DirectiveBinding<string>) {
        el.style.color=binding.value
    }
}